﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Wicresoft.UnifyShow.Business;
using Microsoft.Practices.Unity;


namespace Wicresoft.UnifyShow.Portal.Controllers
{
    public class WorkListPartialViewController : BaseController
    {
        private IIncident incident;
        private IChange change;
        private IProblem problem;

        [InjectionConstructor]
        public WorkListPartialViewController(IIncident iincident, IChange ichange, IProblem iproblem)
        {
            incident = iincident;
            change = ichange;
            problem = iproblem;
        }
        protected override void Dispose(bool disposing)
        {
            ((IDisposable)incident).Dispose();
            ((IDisposable)change).Dispose();
            ((IDisposable)problem).Dispose();
        }


        public ActionResult WorkListPartialViewByincident(int? sid, int? bind, DateTime? sTime, DateTime? eTime)
        {
            List<SiteBranchAndWorkListModel> incidentList = new List<SiteBranchAndWorkListModel>();
            incidentList = incident.GetIncidentInfoList(sid, bind, sTime, eTime);
            return PartialView("WorkListPartialViewByincident", incidentList);
        }
        public ActionResult WorkListPartialViewBychange(int? sid, int? bind, DateTime? sTime, DateTime? eTime)
        {
            List<SiteBranchAndWorkListModel> changeList = new List<SiteBranchAndWorkListModel>();
            changeList = change.GetChangeInfoList(sid, bind, sTime, eTime);
            return PartialView("WorkListPartialViewBychange", changeList);
        }
        public ActionResult WorkListPartialViewByProblem(int? sid, int? bind, DateTime? sTime, DateTime? eTime)
        {
            List<SiteBranchAndWorkListModel> problemList = new List<SiteBranchAndWorkListModel>();
            problemList = problem.GetProblemInfoList(sid, bind, sTime, eTime);
            return PartialView("WorkListPartialViewByproblem", problemList);
        }
    }
}
